package com.xm.xmapp.dialog;

import android.graphics.Color;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.View;

import com.xm.xmapp.dialog.HCDialog.OnClickListener;
import com.xm.xmapp.map.ClusterItem;

public class Clickable extends ClickableSpan {
	private final OnClickListener mListener;
	private ClusterItem item;

	public Clickable(OnClickListener l, ClusterItem item) {
		mListener = l;
		this.item = item;
	}

	/**
	 * 重写父类点击事件
	 */
	@Override
	public void onClick(View v) {
		mListener.onClick(item);
	}

	/**
	 * 重写父类updateDrawState方法 我们可以给TextView设置字体颜色,背景颜色等等...
	 */
	@Override
	public void updateDrawState(TextPaint ds) {
		ds.setColor(Color.parseColor("#695de0"));
	}
}
